﻿<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default"  ValidateRequest="false"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>软件管理中心</title>
    <script type="text/javascript">
        function checked_SoftWare() {
            if (document.getElementById("txtSoftWareName").value == "") {
                alert("软件名称不能为空！");
                return false;
            }
        }
        function checked_BusinessTag() {
            if (document.getElementById("txtBusinessTag_Name").value == "") {
                alert("关键字名称不能为空！");
                return false;
            }
        }
        function checked_WebSite() {
            if (document.getElementById("txtWebSite_Name").value == "") {
                alert("网站名称不能为空！");
                return false;
            } if (document.getElementById("txtWebSite_Address").value == "") {
                alert("网站地址不能为空！");
                return false;
            }
        }
        function Show_Picture_onclick(obj) {
            document.getElementById("hldId").value = obj;
            document.getElementById("My_Picture").src = "Show_Picture.aspx?id="+obj;
            document.getElementById("msg").style.display = "block";
            document.getElementById("msg").style.left = event.clientX;
        }
        function checkedUpload() {
            if (document.getElementById("uploadPhoto").value == "") {
                alert("图片不能为空！");
                return false;
            } else {
                return true;
            }
        }
    </script>
    <style type="text/css">
        .style1
        {
            height: 23px;
        }
        .style2
        {
            height: 30px;
        }
    </style>
</head>
<body>
<a href="Search.aspx">进入查询</a>&nbsp;<a href="Default.aspx">进入添加</a>
    <form id="form1" runat="server">
    <div>
    <table border="1">
        <tr>
            <td>
        <table style="width: 100%;">
            <caption>
                <asp:Label ID="lblTitle" runat="server" Text="添加软件信息"></asp:Label></caption>
            <tr>
                <td>
                    软件名称：
                </td>
                <td>
                    <asp:TextBox ID="txtSoftWareName" runat="server" Width="258px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    关键字：
                </td>
                <td>
                    <asp:TextBox ID="txtSoftWare_Keywords" runat="server" Width="384px" 
                      ></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    是否可用：
                </td>
                <td>
                    <asp:DropDownList ID="ddlSoftWare_IsOk" runat="server">
                        <asp:ListItem Selected="True" Value="0">未知</asp:ListItem>
                        <asp:ListItem Value="1">是</asp:ListItem>
                        <asp:ListItem Value="2">否</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    是否安全：
                </td>
                <td>
                   <asp:DropDownList ID="ddlSoftWare_IsSecure" runat="server">
                        <asp:ListItem Selected="True" Value="0">未知</asp:ListItem>
                        <asp:ListItem Value="1">是</asp:ListItem>
                        <asp:ListItem Value="2">否</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
             <tr>
                <td>
                    商业等级：
                </td>
                <td>
                   <asp:DropDownList ID="ddlSoftWare_Rating" runat="server">
                        <asp:ListItem Selected="True" Value="1">1</asp:ListItem>
                        <asp:ListItem Value="2">2</asp:ListItem>
                        <asp:ListItem Value="3">3</asp:ListItem>
                    </asp:DropDownList>
                </td>
            </tr>
             <tr>
                <td>
                    网盘下载地址：
                </td>
                <td>
                    <asp:TextBox ID="txtSoftWare_NetsiskAddress" runat="server" Width="321px"></asp:TextBox>
                </td>
            </tr>
             <tr>
                <td>
                    网站下载地址：
                </td>
                <td>
                    <asp:TextBox ID="txtSowftWare_WebsiteAddress" runat="server" Width="320px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    备注：
                </td>
                <td>
                    <asp:TextBox ID="txtSoftWare_Remarks" runat="server" Width="453px" 
                        Height="149px" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    上传图片：
                </td>
                <td>
                        <input type="file" runat="server" id="uploadPhoto" name="upPhoto" />
                        <input type="button" runat="server" id="btnUpload" name="btnUploadte"    value="上传图片"  onserverclick="btnUpload_ServerClick"/>
                </td>
            </tr>
            <tr>
                <td colspan="2">

                    
                    <asp:DataList ID="MyDataGrid" runat="server" RepeatDirection="Horizontal" >
                                            <ItemTemplate>
                                                <img src="<%# "Getimg.ashx?id="+Eval("Album_ID") %>" onclick="Show_Picture_onclick('<%# Eval("Album_ID") %>')" style="width: 89px; height: 97px; border-width: 0px" />
                                            </ItemTemplate>
                                        </asp:DataList>
                </td>

            </tr>
            <tr>
                <td>
                    <asp:Button ID="btnSave" runat="server" Text="添加" onclick="btnSave_Click"  OnClientClick="return checked_SoftWare()" />
                </td>
                <td>
                   
                    <asp:Button ID="btnDelete" runat="server" Text="删除" onclick="btnDelete_Click" OnClientClick="return confirm('确定要删除吗？')" />
                   
                &nbsp;
                                       
                </td>
            </tr>
        </table>
        </td>
        <td valign="top">
           <table>
                <caption>添加下载网站</caption>
                <tr>
                    <td>
                        网站名称：
                    </td>
                     <td>
                        <asp:TextBox ID="txtWebSite_Name" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        网站地址：
                    </td>
                    <td>
                        <asp:TextBox ID="txtWebSite_Address" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        收藏等级：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlWebSite_Rating" runat="server">
                        <asp:ListItem Selected="True" Value="1">1</asp:ListItem>
                        <asp:ListItem Value="2">2</asp:ListItem>
                    </asp:DropDownList> 
                    </td>
                </tr>
                <tr>
                    <td>
                        <asp:Button ID="btnSaveWebSite" runat="server" Text="添加" 
                            OnClientClick="return checked_WebSite()" onclick="btnSaveWebSite_Click" />
                    </td>
                    <td>
                       
                    </td>
                </tr>
                <tr>
                    <td>
                        
                    </td>
                    <td>
                       
                    </td>
                </tr>
                <tr>
                    <td>
                        
                    </td>
                    <td>
                       
                    </td>
                </tr>
                 <tr>
                    <td class="style1">
                        
                    </td>
                    <td class="style1">
                       
                    </td>
                </tr>
                 <tr>
                    <td>
                        
                    </td>
                    <td>
                       
                    </td>
                </tr>
                 <tr>
                    <td>
                        
                    </td>
                    <td>
                       
                    </td>
                </tr>
                 <tr >
                    <td colspan="2" style="border:1px solid;">
                      
                    </td>
       
                </tr>
                <tr>
                    <td colspan="2" align=center>
                        添加商业关键字
                    </td>

                </tr>
                <tr>
                    <td>
                        关键字
                    </td>
                    <td>
                        <asp:TextBox ID="txtBusinessTag_Name" runat="server"></asp:TextBox>
                    </td>
                </tr>
                 <tr>
                    <td class="style2">
                        <asp:Button ID="btnSave_Business" runat="server" Text="添加" 
                            OnClientClick="return checked_BusinessTag()" onclick="btnSave_Business_Click" />
                    </td>
                    <td class="style2">
                       
                    </td>
                </tr>
           </table> 
        </td>
        </tr></table>
    </div>
     <table id="msg" style=" display:none; border-bottom:#cccccc 1px solid; border-left:#cccccc 1px solid; border-right:#cccccc 1px solid; border-top:#cccccc 1px solid;position: absolute;  z-index: 100; left: 20px; top: 300px;">
                    <tr>
                        <td><a href="#" onclick="javascript:document.getElementById('msg').style.display='none'"
                                    style="float: left; font-size: smaller;color:Red;">[关闭]</a></td>
                    </tr>
                    <tr>
                        <td>
                            <img src="" id="My_Picture" onerror="this.src='Images/nopic.gif'" />
                         </td>
                    </tr>
                    <tr>
                         <td>
                             <asp:Button ID="btnSaveImage" runat="server" Text="保存到本地磁盘" 
                                 onclick="btnSaveImage_Click" />
                             <asp:HiddenField ID="hldId" runat="server" />
                         </td> 
                    </tr>
      </table>
    </form>

</body>
</html>
